package com.xhx.componet;

import org.springframework.stereotype.Component;

import com.xhx.context.FlowContext;
import com.yomahub.liteflow.core.NodeSwitchComponent;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component("switchCondCmp")
public class SwitchCondCmp extends NodeSwitchComponent {
    @Override
    public String processSwitch() throws Exception {
        FlowContext context = this.getContextBean(FlowContext.class);
        if (context.getType().equals("1")) {
            log.info("走了fixCmp");
            return "fixCmp";
        } else {
            log.info("走了dynamicCmp");
            return "dynamicCmp";
        }
    }
}
